/*	navi-tech 1- Eternal Team(c)
	Nico Durrant 2012
	
	2D vector class
*/

#ifndef VECTOR2_H
#define VECTOR2_H

#include <math.h>

namespace Eternal
{
	namespace Core
	{
		class Vector2
		{
			public:
				Vector2();
				Vector2(const float x, const float y);
				Vector2(const Vector2 &v);
				~Vector2();
				
				inline float Magnitude() const
				{
					return sqrtf((x * x) + (y * y));
				}
				
				inline void Normalize()
				{
					const float m = Magnitude();
					x /= m;
					y /= m;
				}
				
				inline Vector2 DotProduct(const Vector2 v) const
				{
					return Vector2(x * v.x, y * v.y);
				}
				
				float x, y;
			private:
		};
	}
}

#endif
